package com.ruoyi.project.registrationfee.controller;

import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.Inspectionfee.damin.Inspectionfee;
import com.ruoyi.project.registrationfee.damin.SysRegistrationfee;
import com.ruoyi.project.registrationfee.service.SysRegistrationfeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/system/registrationfee")
public class SysRegistrationfeeController extends BaseController {
    @Autowired
    private SysRegistrationfeeService sysRegistrationfeeService;

    /**
     * 查询【请填写功能名称】列表
     */
    @PreAuthorize("@ss.hasPermi('system:registrationfee:list')")
    @GetMapping("/list")
    public TableDataInfo list(SysRegistrationfee sysRegistrationfee)
    {
        startPage();
        List<SysRegistrationfee> list = sysRegistrationfeeService.selectSysRegistrationfeeList(sysRegistrationfee);
        return getDataTable(list);
    }

    @PreAuthorize("@ss.hasPermi('system:registrationfee:query')")
    @GetMapping(value = "/{registrationfeeId}")
    public AjaxResult geInfo(@PathVariable("registrationfeeId") Long registrationfeeId){
        return AjaxResult.success(sysRegistrationfeeService.selectSysRegistrationfeeById(registrationfeeId));
    }

    @PreAuthorize("@ss.hasPermi('system:registrationfee:add')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody SysRegistrationfee sysRegistrationfee)
    {
        return toAjax(sysRegistrationfeeService.insertSysRegistrationfee(sysRegistrationfee));
    }

    @PreAuthorize("@ss.hasPermi('system:registrationfee:edit')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody SysRegistrationfee sysRegistrationfee)
    {
        return toAjax(sysRegistrationfeeService.updateSysRegistrationfee(sysRegistrationfee));
    }

    @PreAuthorize("@ss.hasPermi('system:registrationfee:remove')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
    @DeleteMapping("/{registrationfeeIds}")
    public AjaxResult remove(@PathVariable Long[] registrationfeeIds)
    {
        return toAjax(sysRegistrationfeeService.deleteSysRegistrationfeeByIds(registrationfeeIds));
    }



}
